<% cache comment do %>
  <%= turbo_frame_tag comment, :container do %>
    <%# Bump for CSS changes: 2025-06-30 -%>
    <div id="<%= dom_id(comment) %>" data-creator-id="<%= comment.creator_id %>"  class="comment flex align-start full-width <%= "comment--system" if comment.creator.system? %>">
      <figure class="comment__avatar flex-item-no-shrink" aria-hidden="true">
        <%= avatar_tag comment.creator, hidden_for_screen_reader: true %>
      </figure>

      <div class="comment__content flex flex-column flex-item-grow full-width">
        <div class="comment__author flex align-center gap-half">
          <h3 class="font-weight-normal txt-normal flex-item-justify-start min-width overflow-ellipsis">
            <strong>
              <%= link_to comment.creator.name, comment.creator, class: "txt-ink btn btn--plain fill-transparent", data: { turbo_frame: "_top" } %>
            </strong>

            <%= link_to comment, class: "txt-undecorated txt-ink translucent txt-normal txt-capitalize", data: { turbo_frame: "_top" } do %>
              <%= local_datetime_tag comment.created_at, style: :agoorweekday %>,
              <%= local_datetime_tag comment.created_at, style: :time %>
            <% end %>
          </h3>

          <%= link_to edit_card_comment_path(comment.card, comment),
                class: "comment__edit btn btn--circle borderless translucent", data: { only_visible_to_you: true } do %>
            <%= icon_tag "menu-dots-horizontal" %>
            <span class="for-screen-reader">Edit this comment</span>
          <% end %>
        </div>

        <div class="comment__body rich-text-content" data-controller="syntax-highlight retarget-links" data-turbo-permanent>
          <%= comment.body %>
        </div>

        <%= render "cards/comments/reactions/reactions", comment: comment %>
      </div>
    </div>
  <% end %>
<% end %>
